import 'package:flutter/material.dart';
import 'package:yuan_hang_app/base/base_state.dart';
import 'package:yuan_hang_app/base/full_base_page.dart';
import 'package:yuan_hang_app/res/w_colors.dart';
import 'package:yuan_hang_app/res/w_constant.dart';
import 'package:yuan_hang_app/res/w_dimens.dart';
import 'package:yuan_hang_app/utils/common_req_utils.dart';
import 'package:yuan_hang_app/utils/size_utils.dart';
import 'package:yuan_hang_app/utils/string_utils.dart';
import 'package:yuan_hang_app/widget/label_item.dart';
import 'package:yuan_hang_app/widget/w_line.dart';
import 'package:yuan_hang_app/widget/w_text.dart';

class StoreDetailPage extends StatefulWidget {
  Map storeInfo;

  StoreDetailPage({super.key, required this.storeInfo});

  @override
  BaseState<StoreDetailPage> createState() => _StoreDetailPageState();
}

class _StoreDetailPageState extends BaseState<StoreDetailPage> {
  @override
  FullBasePage buildState(BuildContext context) {
    return FullBasePage(
      title: "车辆库存详情",
      child: ListView(
        padding: EdgeInsets.zero,
        shrinkWrap: true,
        children: [
          WLine(height: 1.px,),
          LabelItem(
          label: "订单号",
          value: StringUtils.safeGetValue(widget.storeInfo["orderNo"],
              placeHolder: "-"),
          labelType: LabelType.TEXT,
        ),
          LabelItem(
            label: "订单类型",
            value: CommonReqUtils.exchangeCodeToName2(
                WConstant.storeOrderStatusList, widget.storeInfo["orderType"]),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "门店代码",
            value: StringUtils.safeGetValue(widget.storeInfo["code"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "门店名称",
            value: StringUtils.safeGetValue(widget.storeInfo["sname"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "VIN",
            value: StringUtils.safeGetValue(widget.storeInfo["vin"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "车型",
            value: StringUtils.safeGetValue(widget.storeInfo["modelName"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "配置",
            value: StringUtils.safeGetValue(widget.storeInfo["configName"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "外饰",
            value: StringUtils.safeGetValue(widget.storeInfo["colorName"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "内饰",
            value: StringUtils.safeGetValue(widget.storeInfo["trimColorName"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "车辆状态",
            value: CommonReqUtils.exchangeCodeToName2(
                WConstant.storeCarStatusList, widget.storeInfo["lifeCycle"]),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "配车状态",
            value: CommonReqUtils.exchangeCodeToName2(
                WConstant.storeMatchCarStatusList,
                widget.storeInfo["vhclMatchStatus"]),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "锁车状态",
            value: CommonReqUtils.exchangeCodeToName2(
                WConstant.storeLockStatusList, widget.storeInfo["lockStatus"]),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "仓库名称",
            value: StringUtils.safeGetValue(widget.storeInfo["warehouseName"],
                placeHolder: "-"),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "下线日期",
            value: StringUtils.safeGetValue(widget.storeInfo["produceDate"],
            ),
            labelType: LabelType.TEXT,
          ),
          LabelItem(
            label: "入库日期",
            isLast: true,
            value: StringUtils.safeGetValue(widget.storeInfo["storageDate"]),

            labelType: LabelType.TEXT,
          ),],
      ),
    );
  }


}
